import { defHttp } from '@/utils/http/axios';
import { SystemOrganizationModel, EditSystemOrganizationParams } from './model/system';
import { ErrorMessageMode } from '#/axios';

export function getSystemOrganization(mode: ErrorMessageMode = 'message') {
  return defHttp.get<SystemOrganizationModel>(
    {
      url: '/system/organizations/info',
    },
    {
      errorMessageMode: mode
    }
  );
}

export function editSystemOrganization(params: EditSystemOrganizationParams, mode: ErrorMessageMode = 'message') {
  return defHttp.post<SystemOrganizationModel>(
    {
      url: '/system/organizations/edit',
      params,
    },
    {
      successMessageMode: mode,
      errorMessageMode: mode,
    }
  );
}